﻿using System.Text;
using WebSocketSharp.Server;

namespace WbSocket.Winform
{
    internal class HTMLPageRequest : BaseRequest
    {
        public HTMLPageRequest(HttpRequestEventArgs ee) : base(ee)
        {
            ee.Response.ContentType = "text/html";
            ee.Response.ContentEncoding = Encoding.UTF8;
        }
        protected override string UrlPath
        {
            get
            {
                string path = base.UrlPath;
                if (path.Contains("/user/"))
                {
                    return "/user/[id].html";
                }
                return path + ".html";
            }
        }
    }
}